package utils;

import java.util.Vector;

public class Polygonal {
	private Vector<Position> segments;
	

	/**
	 * @param segments
	 */
	public Polygonal(Vector<Position> segments) {
		super();
		this.segments = segments;
	}

	public Polygonal() {
		super();
		this.segments = new Vector<Position>();
	}
	
	/**
	 * @return the segments
	 */
	public Vector<Position> getSegments() {
		return segments;
	}

	/**
	 * @param segments the segments to set
	 */
	public void setSegments(Vector<Position> segments) {
		this.segments = segments;
	}
	
	/**
	 * @return pointsX
	 * 
	 */
	public int[] getPointsX(){
		int[] xPoints = new int[segments.size()]; 
		for(int i=0;i<segments.size();i++)
		      xPoints[i]= (int)segments.get(i).getX();
		
		return xPoints;		
	}
	
	/**
	 * @return pointsY
	 * 
	 */
	public int[] getPointsY(){
		int[] yPoints = new int[segments.size()]; 
		for(int i=0;i<segments.size();i++)
		      yPoints[i]= (int)segments.get(i).getY();
		
		return yPoints;		
	}
	
	/**
	 * 
	 * @param position
	 */
	public void addPosition(Position position){
		this.segments.add(position);
	}
	
	/**
	 * Print points
	 */
	public void printPointsX(){
		for(int i=0; i<segments.size(); i++){
			System.out.println(segments.get(i).getX());
		}
	}
	
	/**
	 * Print points
	 */
	public void printPointsY(){
		for(int i=0; i<segments.size(); i++){
			System.out.println(segments.get(i).getY());
		}
	}
	
}
